package com.test.vote.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * match
 * @author 
 */
public class Match implements Serializable {
    /**
     * 比赛id
     */
    private Integer matchId;

    /**
     * 比赛名称
     */
    private String matchName;

    /**
     * 比赛时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date matchTime;

    /**
     * 比赛地点
     */
    private String matchAddress;

    /**
     * 比赛说明
     */
    private String matchDesc;

    /**
     * 比赛状态 0：未开始 1：进行中 2：结束
     */
    private Integer matchStatus;

    private static final long serialVersionUID = 1L;

    public Integer getMatchId() {
        return matchId;
    }

    public void setMatchId(Integer matchId) {
        this.matchId = matchId;
    }

    public String getMatchName() {
        return matchName;
    }

    public void setMatchName(String matchName) {
        this.matchName = matchName;
    }

    public Date getMatchTime() {
        return matchTime;
    }

    public void setMatchTime(Date matchTime) {
        this.matchTime = matchTime;
    }

    public String getMatchAddress() {
        return matchAddress;
    }

    public void setMatchAddress(String matchAddress) {
        this.matchAddress = matchAddress;
    }

    public String getMatchDesc() {
        return matchDesc;
    }

    public void setMatchDesc(String matchDesc) {
        this.matchDesc = matchDesc;
    }

    public Integer getMatchStatus() {
        return matchStatus;
    }

    public void setMatchStatus(Integer matchStatus) {
        this.matchStatus = matchStatus;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Match other = (Match) that;
        return (this.getMatchId() == null ? other.getMatchId() == null : this.getMatchId().equals(other.getMatchId()))
            && (this.getMatchName() == null ? other.getMatchName() == null : this.getMatchName().equals(other.getMatchName()))
            && (this.getMatchTime() == null ? other.getMatchTime() == null : this.getMatchTime().equals(other.getMatchTime()))
            && (this.getMatchAddress() == null ? other.getMatchAddress() == null : this.getMatchAddress().equals(other.getMatchAddress()))
            && (this.getMatchDesc() == null ? other.getMatchDesc() == null : this.getMatchDesc().equals(other.getMatchDesc()))
            && (this.getMatchStatus() == null ? other.getMatchStatus() == null : this.getMatchStatus().equals(other.getMatchStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMatchId() == null) ? 0 : getMatchId().hashCode());
        result = prime * result + ((getMatchName() == null) ? 0 : getMatchName().hashCode());
        result = prime * result + ((getMatchTime() == null) ? 0 : getMatchTime().hashCode());
        result = prime * result + ((getMatchAddress() == null) ? 0 : getMatchAddress().hashCode());
        result = prime * result + ((getMatchDesc() == null) ? 0 : getMatchDesc().hashCode());
        result = prime * result + ((getMatchStatus() == null) ? 0 : getMatchStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", matchId=").append(matchId);
        sb.append(", matchName=").append(matchName);
        sb.append(", matchTime=").append(matchTime);
        sb.append(", matchAddress=").append(matchAddress);
        sb.append(", matchDesc=").append(matchDesc);
        sb.append(", matchStatus=").append(matchStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}